<?php defined('InNcPHP') or exit('Access Invalid!');?>
<link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_URL;?>/common/jquery-ui/themes/ui-lightness/jquery.ui.css"  />
<link rel="stylesheet"  type="text/css" href="<?php echo RESOURCE_URL;?>/common/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.min.css">
<style>
    .show { display: block; }
    .hide { display: none; }
    .code_img{display: none;}
</style>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <h3><?php echo $lang['bargain_index_ticket'];?></h3>
            <?php echo $output['top_link'];?>
        </div>
    </div>
    <div class="fixed-empty"></div>
    <!--  操作提示  -->
    <table class="table tb-type2" id="prompt">
        <tbody>
        <tr class="space odd">
            <th colspan="12">
                <div class="title">
                    <h5><?php echo $lang['nc_prompts']; ?></h5>
                    <span class="arrow"></span>
                </div>
            </th>
        </tr>
        <tr>
            <td>
                <ul>
                    <li>请根据银行返回的失败信息对该商户信息补充,需要对哪部分信息修改填写相对应信息就好！以下信息不是未必填！！！</li>
                    <li><label>银行驳回理由：</label> <?php echo $output['merchant_info']['not_passcause'] ?></li>
                </ul>
            </td>
            <td>
            </td>
        </tr>
        </tbody>
    </table>
    <form id="merchant_form" method="post" enctype="multipart/form-data">
        <input type="hidden" name="form_submit" value="ok" />
        <table class="table tb-type2 nobdb">
            <tbody>

            <!-- 店铺简称 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_mch_shortname'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="mch_shortname" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '商户的简称，例如‘旅帮’';?></td>
            </tr>

            <!-- 店铺联系人 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_name'];?>:</label>
                </td>
            </tr>

            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="contact" class="txt" value=""></td>
                <td class="vatop tips"><?php echo $lang['bargain_add_show_price_notice'];?></td>
            </tr>

            <!-- 联系人手机 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_phone'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="mobile" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '商户联系人的手机号码';?></td>
            </tr>
            <!-- 商家营业执照 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_lic'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><span class="type-file-show">
                        <span class="type-file-show">
                        <img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
                        <div class="type-file-preview" style="display: none;">
                            <img id="view_img" src="<?php echo $output['merchant_info']['mc_lic_img']; ?>" style="max-height: 100px;max-width: 100px;">
                        </div>
                    </span>
                    </span> <span class="type-file-box">
                        <input type='text' name='textfield' id='textfield' class='type-file-text' />
                        <input type='button' name='button' id='button' value='' class='type-file-button' />
                        <input name="mc_lic_img" type="file" class="type-file-file" id="image" size="30" hidefocus="true" />
                    </span>
                </td>
                <td class="vatop tips"><?php echo '商户的营业执照';?></td>
            </tr>

            <!-- 身份证正面照片 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_idcard'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><span class="type-file-show">
                        <span class="type-file-show">
                        <img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
                        <div class="type-file-preview" style="display: none;">
                            <img id="view_img" src="<?php echo $output['merchant_info']['mc_idcard_img']; ?>" style="max-height: 100px;max-width: 100px;">
                        </div>
                    </span>
                    </span> <span class="type-file-box">
                        <input type='text' name='textfield' id='textfield1' class='type-file-text' />
                        <input type='button' name='button' id='button' value='' class='type-file-button' />
                        <input name="mc_idcard_img" type="file" class="type-file-file" id="image1" size="30" hidefocus="true" />
                    </span>
                </td>
                <td class="vatop tips"><?php echo  '商户联系的人身份证正面照';?></td>
            </tr>

            <!-- 身份证反面照片 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_idcardb'];?>:</label>
                </td>
            </tr>

            <tr class="noborder">
                <td class="vatop rowform"><span class="type-file-show">
                        <span class="type-file-show">
                        <img class="show_image" src="<?php echo ADMIN_TEMPLATES_URL;?>/images/preview.png">
                        <div class="type-file-preview" style="display: none;">
                            <img id="view_img" src="<?php echo $output['merchant_info']['mc_idcardb_img']; ?>" style="max-height: 100px;max-width: 100px;">
                        </div>
                    </span>
                    </span> <span class="type-file-box">
                        <input type='text' name='textfield' id='textfield2' class='type-file-text' />
                        <input type='button' name='button' id='button' value='' class='type-file-button' />
                        <input name="mc_idcardb_img" type="file" class="type-file-file" id="image2" size="30" hidefocus="true" />
                    </span>
                </td>
                <td class="vatop tips"><?php echo '商户联系的人身份证反面照';?></td>
            </tr>
            <!-- 商家邮箱 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_email'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="email" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '请填写商家联系人的真实邮箱';?></td>
            </tr>

            <!-- 商家所在省份 -->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_province'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="province" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '填写商家所在的省份，例如‘福建省’';?></td>
            </tr>

            <!-- 商家所在城市-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_city'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="city" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '填写商家所在的城市，例如‘厦门市’';?></td>
            </tr>
            <!-- 商家所在城市-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_city'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="district" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '填写商家所在的区，例如‘思明区’';?></td>
            </tr>

            <!-- 商家详细地址-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_address'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="address" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '填写商家所在的详细地址，例如‘思明区xxxxxxxx’';?></td>
            </tr>

            <!-- 商家服务电话-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_service_phone'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="service_phone" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '此处请填写商家的座机，若无座机请填写商家联系的人手机号';?></td>
            </tr>

            <!-- 商家结算银行卡-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_balance_account'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="balance_account" class="txt"  value=""></td>
                <td class="vatop tips"><?php echo '商家的结算银行卡号，请仔细核对填写';?></td>
            </tr>

            <!-- 商家结算银行卡名称-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_balance_name'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="balance_name" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '银行卡开户人姓名，例如：‘张三’';?></td>
            </tr>
            <!-- 商家开户支行-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_bank_no'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="bank_no" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '商家结算银行卡的开户支行的全称名，例如：‘中国工商银行股份有限公司厦门湖滨中路支行’，此处请认真核实开户支行全称名填写,否则将导致商户支付接口认证失败！';?></td>
            </tr>

            <!-- 商家结算类型-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo '结算类型';?>:</label>
                </td>
            </tr>
            <tr class="noborder add_res" >
                <td class="vatop rowform" style="width: 500px;">
                    <select  name="balance_type" class="class-select">
                        <option value="">结算类型：</option>
                        <option value="1">对私</option>
                        <option value="0">对公</option>
                    </select>
                </td>
                <td class="vatop tips"></td>
            </tr>
            <!-- 商家所属行业-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_industry_no'];?>:</label>
                </td>
            </tr>
            <tr class="noborder add_res" >
                <td class="vatop rowform" style="width: 500px;">
                    <select id="store_areaId_01" class="class-select">
                        <option value="">商户类型</option>
                        <?php if (is_array($output['industry'])): ?>
                            <?php foreach ($output['industry'] as $k => $v): ?>
                                <option value="<?php echo $v['class_id']; ?>"><?php echo $v['name']; ?></option>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </select>
                    <select id="store_areaId_02"  class="class-select">

                        <option value="">一级类目</option>
                    </select>
                    <select id="store_areaId_03" class="class-select">

                        <option value="">二级类目</option>
                    </select>
                    <select id="store_areaId_04" class="class-select">

                        <option value="">三级类目</option>
                    </select>
                    <input type="hidden" name ='three_class'>
                </td>
                <td class="vatop tips"></td>
            </tr>
            <!--<tr class="noborder">
                <td class="vatop rowform"><input type="text" name="industry_no" class="txt" value="<?php /*echo $output['merchant_info']['industry_no']; */?>"></td>
                <td class="vatop tips"><?php /*echo $lang['bargain_add_store_notice'];*/?></td>
            </tr>-->



            <!-- 商家身份证号码-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_id_card_no'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="id_card_no" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '商户联系人的身份证号码';?></td>
            </tr>
            <!-- 微信公众账号支付费率-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_payment_type3'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="payment_type3" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '微信公众账号支付费率(万分率，如60)';?></td>
            </tr>
            <!-- 微信支付宝刷卡支付费率-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_payment_type8'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="payment_type8" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '微信支付宝刷卡支付费率(万分率，如60)';?></td>
            </tr>
            <!-- 支付宝扫码支付费率-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_payment_type7'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="payment_type7" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '支付宝扫码支付费率(万分率，如60)';?></td>
            </tr>
            <!-- 营业执照注册号-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_license_num'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="license_num" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '请根据实际营业执照信息填写';?></td>
            </tr>

            <!-- 营业执照开始时间-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_license_start_date'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="license_start_date" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '例如：2014年11月6日，填写格式为：2014-11-06';?></td>
            </tr>



            <!-- 营业执照到期时间-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_license_end_date'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="license_end_date" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '例如：2014年11月6日，填写格式为：2014-11-06';?></td>
            </tr>

            <!-- 营业执照经营范围-->
            <tr class="noborder">
                <td colspan="2" class="required">
                    <label class="validation"><?php echo $lang['merchant_license_scope'];?>:</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform"><input type="text" name="license_scope" class="txt" value=""></td>
                <td class="vatop tips"><?php echo '请根据实际营业执照信息填写';?></td>
            </tr>
            <!-- 提交 -->
            <tr class="tfoot">
                <td colspan="2" >
                    <a href="JavaScript:void(0);" class="btn" id="submitBtn">
                        <span><?php echo $lang['nc_submit'];?></span>
                    </a>
                </td>
            </tr>
            </tfoot>
            <input type="hidden" name ='business_type'>
            <input type="hidden" name ='one_class'>
            <input type="hidden" name ='tow_class'>

        </table>
    </form>
</div>
<script>
    $("#submitBtn").click(function(){

            $("#merchant_form").submit();

    });
    //图片文件选择
    $("#image").change(function(){
        $("#textfield").val($(this).val());
    });
    //图片文件选择
    $("#image1").change(function(){
        $("#textfield1").val($(this).val());
    });
    //图片文件选择
    $("#image2").change(function(){
        $("#textfield2").val($(this).val());
    });
    //选择商户类型
    $("#store_areaId_01").change(function(){
        var _areaID = $(this).val();
        var typename = $(this).find("option:selected").text();
        $("[name ='business_type']").val(typename);
        _this = $("#store_areaId_01");
        if(_areaID){
            $.getJSON("./index.php?act=member&op=getAreaChild&parent_id=" + _areaID, function(data){
                $obj = $("#store_areaId_02");
                $obj.empty();
                $obj.append('<option value="">一级类目</option>');
                $obj.next("select").empty();
                $obj.next("select").append('<option value="">二级类目</option>');
                $obj.next().next('select').empty();
                $obj.next().next("select").append('<option value="">三级类目</option>');
                $.each(data, function(i,item){

                    $obj.append('<option value="'+item.class_id+'">'+item.name+'</option>');
                });
            });
        }else{
            _this.nextAll("select").empty();
            _this.next("select").append('<option value="">一级类目</option>');
            _this.next("select").next('select').append('<option value="">二级类目</option>');
            _this.next("select").next().next('select').append('<option value="">三级类目</option>');
        }
    });
    //选择一级分类

    $("#store_areaId_02").change(function(){
        var _areaID = $(this).val();
        _this = $("#store_areaId_2");
        var one_class_name = $(this).find("option:selected").text();
        $("[name='one_class']").val(one_class_name);
        if(_areaID){
            $.getJSON("index.php?act=member&op=getAreaChild&parent_id=" + _areaID, function(data){
                $obj = $("#store_areaId_03");
                $obj.empty();
                $obj.append('<option value="">二级类目</option>');
                $.each(data, function(i,item){
                    $obj.append('<option value="'+item.class_id+'">'+item.name+'</option>');
                });
            });
        }else{
            _this.nextAll("select").empty();
            _this.next("select").append('<option value="">二级类目</option>');
            _this.next("select").next('select').append('<option value="">三级类目</option>');
        }
    });
    //选择二级级分类

    $("#store_areaId_03").change(function(){
        var _areaID = $(this).val();
        _this = $("#store_areaId_3");
        var tow_class_name = $(this).find("option:selected").text();
        $("[name='tow_class']").val(tow_class_name);
        if(_areaID){
            $.getJSON("index.php?act=member&op=getAreaChild&parent_id=" + _areaID, function(data){
                $obj = $("#store_areaId_04");
                $obj.empty();
                $obj.append('<option value="">三级类目</option>');
                $.each(data, function(i,item){
                    $obj.append('<option value="'+item.class_id+'">'+item.name+'</option>');
                });
            });
        }else{
            _this.nextAll("select").empty();
            _this.next("select").append('<option value="">三级类目</option>');

        }
    });
    $("#store_areaId_04").change(function(){
        var three_class_name = $(this).find("option:selected").text();
        $("[name = 'three_class']").val(three_class_name);
    });



</script>

